#ifndef RISING_STAR_DATABASE_H
#define RISING_STAR_DATABASE_H
#include <map>
#include <list>
#include "Config.h"
using namespace std;

namespace RisingStar
{

	class CDatabase
	{
	public:
		CDatabase(){};
		~CDatabase(){};
		
		//连接数据库
		virtual bool Connect(string username,string password,string dataname,string ip,WORD port = 3306) = 0;
		
		virtual bool Execute(string sql) = 0;
		
		//获取详细信息
		virtual bool Detail(string sql,map<string,string>& detail) = 0;
		virtual bool SearchList(string sql,list<map<string,string> >& infoList) = 0;
		//关闭连接
		virtual bool Close() = 0;
	protected:
		
	private:
		
	};
	typedef boost::shared_ptr<CDatabase> DatabasePtr;
};

#endif